package gestionSimpleATester;

import static org.junit.Assert.*;

import java.util.Vector;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
 * test without an account !
 * 
 * @author Joshep
 *
 */
public class PersonTest {

	Person p;
	
	@Before
	public void setUp() throws Exception {
		p = new Person("personne");
	}

	@After
	public void tearDown() throws Exception {
		p = null;
	}

	@Test
	public void testPerson() {
		@SuppressWarnings("unused")
		Person x1 = new Person(null);
		@SuppressWarnings("unused")
		Person x2 = new Person("x");
	}

	@Test
	public void testGetName() {
		/***Validation of initialization of the constructor **/
		Person p = new Person("Joe");
		assertEquals(p.getName(), "Joe");
		Person pNull = new Person(null);
		assertEquals(pNull.getName(), null);
	}

	@Test
	public void testSetName() {
		/*** getter is validation by the step before **/
		p.setName(null);
		assertEquals(null,p.getName());
		p.setName("Symon");
		assertEquals("Symon",p.getName());
	}

	@SuppressWarnings("unchecked")
	@Test
	public void testGetAccounts() {
		p.setAccounts(null);
		assertSame(null,p.getAccounts());
		Vector v1 = new Vector();
		Vector v2 = new Vector();
		v1.add(9);
		p.setAccounts(v1);
		assertSame(v1,p.getAccounts());
		p.setAccounts(v2);
		assertSame(v2,p.getAccounts());
	}

	@SuppressWarnings("unchecked")
	@Test
	public void testSetAccounts() {
		p.setAccounts(null);
		assertSame(null,p.getAccounts());
		Vector v1 = new Vector();
		Vector v2 = new Vector();
		v1.add(9);
		p.setAccounts(v1);
		assertSame(v1,p.getAccounts());
		p.setAccounts(v2);
		assertSame(v2,p.getAccounts());
	}

	@Test
	public void testAccountsIterator() {
		fail("Not yet implemented");
	}

	@Test
	public void testAddAccounts() {
		fail("Not yet implemented");
	}

	@Test
	public void testRemoveAccounts() {
		fail("Not yet implemented");
	}

	@Test
	public void testIsAccountsEmpty() {
		/*** Must return True***/
		assertTrue("Empty", p.isAccountsEmpty());
	}

	@Test
	public void testClearAccounts() {
		fail("Not yet implemented");
	}

	@Test
	public void testContainsAccounts() {
		fail("Not yet implemented");
	}

	@Test
	public void testContainsAllAccounts() {
		fail("Not yet implemented");
	}

	@Test
	public void testAccountsSize() {
		/****Must return EMPTY ***/
		assertEquals(p.accountsSize(),0);
	}

	@Test
	public void testAccountsToArray() {
		fail("Not yet implemented");
	}

}
